package com.szewec.ps.base;

import java.util.ArrayList;
import java.util.List;

public class Enums {
    public interface IKeyValueEnum {
        Object getKey();

        Object getValue();
    }

    public static class KeyValueEnumUtil {

        public static Object getEnumByKey(Class<? extends IKeyValueEnum> enumClass, Object key) {
            if (!enumClass.isEnum()) {
                return null;
            }
            IKeyValueEnum[] enumConstants = enumClass.getEnumConstants();
            if (enumConstants == null || enumConstants.length == 0) {
                return null;
            }

            for (IKeyValueEnum eObj : enumConstants) {
                if (eObj.getKey().equals(key)) {
                    return eObj;
                }
            }
            return null;
        }

        public static Object getValueByKey(Class<? extends IKeyValueEnum> enumClass, Object key) {
            if (!enumClass.isEnum()) {
                return null;
            }
            IKeyValueEnum[] enumConstants = enumClass.getEnumConstants();
            if (enumConstants == null || enumConstants.length == 0) {
                return null;
            }

            for (IKeyValueEnum eObj : enumConstants) {
                if (eObj.getKey().equals(key)) {
                    return eObj.getValue();
                }
            }
            return null;
        }

        public static Object getKeyByValue(Class<? extends IKeyValueEnum> enumClass, Object value) {
            if (!enumClass.isEnum()) {
                return null;
            }
            IKeyValueEnum[] enumConstants = enumClass.getEnumConstants();
            if (enumConstants == null || enumConstants.length == 0) {
                return null;
            }

            for (IKeyValueEnum eObj : enumConstants) {
                if (eObj.getValue().equals(value)) {
                    return eObj.getKey();
                }
            }
            return null;
        }

        @SuppressWarnings("all")
        public static ArrayList getEnumValueList(Class<? extends IKeyValueEnum> enumClass) {
            if (!enumClass.isEnum()) {
                return null;
            }
            IKeyValueEnum[] enumConstants = enumClass.getEnumConstants();
            if (enumConstants == null || enumConstants.length == 0) {
                return null;
            }

            ArrayList<Object> list = new ArrayList<>();
            for (IKeyValueEnum eObj : enumConstants) {
                list.add(eObj.getValue());
            }
            return list;
        }


    }

    @SuppressWarnings("all")
    public enum ResponseCodeEnum implements IKeyValueEnum {
        请求成功(10000, "请求成功"),
        ;

        private Integer key;
        private String value;

        ResponseCodeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }
    }


    @SuppressWarnings("all")
    public enum ProjTypeGrade1 implements IKeyValueEnum {
        发展战略(1, "发展战略"),
        规划项目(2, "规划项目"),
        建设项目(3, "建设项目"),
        实施方案(4, "实施方案"),
        研究课题(5, "研究课题"),
        ;

        private Integer key;
        private String value;

        ProjTypeGrade1(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }


        public static ProjTypeGrade1 getEnumByKey(Integer key) {
            return (ProjTypeGrade1) KeyValueEnumUtil.getEnumByKey(ProjTypeGrade1.class, key);
        }

        public static ArrayList<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ProjTypeGrade1.class);
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ProjTypeGrade1.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ProjTypeGrade1.class, value);
        }
    }


    @SuppressWarnings("all")
    public enum ProjTypeGrade2 implements IKeyValueEnum {
        长远发展策略研究(1, "长远发展策略研究", 1),
        城市交通白皮书(2, "城市交通白皮书", 1),

        对外交通规划(3, "对外交通规划", 2),
        市级综合交通规划(4, "市级综合交通规划", 2),
        城市专项交通规划(5, "城市专项交通规划", 2),
        区级综合交通规划(6, "区级综合交通规划", 2),
        区级专项交通规划(7, "区级专项交通规划", 2),
        行业发展规划(8, "行业发展规划", 2),
        片区交通规划(9, "片区交通规划", 2),
        片区交通改善规划(10, "片区交通改善规划", 2),

        五年发展规划(11, "五年发展规划", 3),
        年度实施计划(12, "年度实施计划", 3),
        应急项目计划(13, "应急项目计划", 3),
        专项建设计划(14, "专项建设计划", 3),

        交通详规方案(15, "交通详规方案", 4),
        交通拥堵治理方案(16, "交通拥堵治理方案", 4),
        其他专项方案(17, "其他专项方案", 4),

        行业政策与法规研究(18, "行业政策与法规研究", 5),
        交通规范与标准研究(19, "交通规范与标准研究", 5),
        调研研究(20, "调研研究", 5),
        交通模型与仿真系统研究(21, "交通模型与仿真系统研究", 5),
        其他专项研究(22, "其他专项研究", 5),
        ;

        private Integer key;
        private String value;
        private Integer parentKey;

        ProjTypeGrade2(Integer key, String value, Integer parentKey) {
            this.key = key;
            this.value = value;
            this.parentKey = parentKey;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }

        public Integer getParentKey() {
            return parentKey;
        }

        public static ArrayList<ProjTypeGrade2> getEnumListByParentKey(Integer parentKey) {
            ProjTypeGrade2[] enumConstants = values();
            ArrayList<ProjTypeGrade2> list = new ArrayList<>();
            for (ProjTypeGrade2 eObj : enumConstants) {
                if (eObj.getParentKey().equals(parentKey)) {
                    list.add(eObj);
                }
            }
            return list;
        }

        public static ProjTypeGrade2 getEnumByKey(Integer key) {
            return (ProjTypeGrade2) KeyValueEnumUtil.getEnumByKey(ProjTypeGrade2.class, key);
        }

        public static ArrayList<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ProjTypeGrade2.class);
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ProjTypeGrade2.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ProjTypeGrade2.class, value);
        }
    }


    @SuppressWarnings("all")
    public enum ProjectMemberTypeEnum implements IKeyValueEnum {
        项目成员(0, "项目成员"),
        项目负责人(1, "项目负责人"),
        ;

        private Integer key;
        private String value;

        ProjectMemberTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }
    }

    public enum RoadSeparateTypeEnum implements IKeyValueEnum {
        SLOW_LANE(0, "人非混行"),
        MARKING(1, "标线隔离"),
        PHYSICS(2, "物理隔离"),
        ;

        private Integer key;
        private String value;

        RoadSeparateTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(RoadSeparateTypeEnum.class, value);
        }
    }

    public enum TaskInvestigationTypeEnum implements IKeyValueEnum {
        INFRASTRUCTURE(1, "基础设施调查"),
        TRAFFIC(2, "交通量调查"),
        ROAD_TRAFFIC(101, "道路交通"),
        PUBLIC_TRANSPORTATION(102, "公共交通"),
        STATIC_TRAFFIC(103, "静态交通"),
        SLOW_TRAFFIC(104, "慢行交通"),
        HUB_TRAFFIC(105, "枢纽交通"),
        ;
        private Integer key;
        private String value;

        TaskInvestigationTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TaskInvestigationTypeEnum.class, value);
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TaskInvestigationTypeEnum.class, key);
        }
    }

    /**
     * 任务状态枚举类
     */
    public enum TaskStatusEnum implements IKeyValueEnum {
        NOT_STARTED(1, "未开始"),
        UNDER_WAY(2, "进行中"),
        SUSPEND(3, "暂停中"),
        COMPLETED(4, "已完成"),
        ;
        private Integer key;
        private String value;

        TaskStatusEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TaskStatusEnum.class, key);
        }
    }

    /**
     * 现代轨道交通 运营模式枚举类
     */
    public enum OperationModeEnum implements IKeyValueEnum {
        NOT_STARTED(1, "独立路权"),
        UNDER_WAY(2, "优先路权"),
        SUSPEND(3, "混合路权"),
        ;
        private Integer key;
        private String value;

        OperationModeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(OperationModeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(OperationModeEnum.class, value);
        }
    }

    /**
     * 现代轨道交通 线路模式枚举类
     */
    public enum LineModeEnum implements IKeyValueEnum {
        NOT_STARTED(1, "全封闭"),
        UNDER_WAY(2, "部分交叉路口开放"),
        SUSPEND(3, "全开放"),
        ;
        private Integer key;
        private String value;

        LineModeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(LineModeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(LineModeEnum.class, value);
        }
    }

    /**
     * 现代轨道交通 车站形式枚举类
     */
    public enum StationFormEnum implements IKeyValueEnum {
        NOT_STARTED(1, "岛式站台"),
        UNDER_WAY(2, "侧式站台"),
        SUSPEND(3, "混合式站台"),
        ;
        private Integer key;
        private String value;

        StationFormEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(StationFormEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(StationFormEnum.class, value);
        }
    }

    /**
     * 机动车道 辅路枚举类
     */
    public enum ServiceRoadEnum implements IKeyValueEnum {
        NOTHING(0, "无"),
        ONE(1, "1"),
        TWO(2, "2"),
        ;
        private Integer key;
        private String value;

        ServiceRoadEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ServiceRoadEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ServiceRoadEnum.class, value);
        }
    }

    /**
     * 机动车道 车道类型枚举类
     */
    public enum LaneTypeEnum implements IKeyValueEnum {
        ORDINARY_LANE(1, "普通车道"),
        CLIMBING_LANE(2, "爬坡车道"),
        BUS_LANE(3, "公交专用道"),
        TIDAL_LANE(4, "潮汐车道"),
        VARIABLE_SPEED_LANE(5, "变速车道"),
        PASSING_LANE(6, "错车道"),
        ESCAPE_LANE(7, "避险车道"),
        EMERGENCY_STOP(8, "紧急停车带"),
        ;
        private Integer key;
        private String value;

        LaneTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(LaneTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(LaneTypeEnum.class, value);
        }
    }

    /**
     * 机动车道 铺面形式枚举类
     */
    public enum PavementFormEnum implements IKeyValueEnum {
        ASPHALT(1, "沥青混凝土"),
        CEMENT(2, "水泥混凝土"),
        ;
        private Integer key;
        private String value;

        PavementFormEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(PavementFormEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(PavementFormEnum.class, value);
        }
    }

    /**
     * 交通隔离设施 分隔带枚举类
     */
    public enum SeparatorEnum implements IKeyValueEnum {
        MEDIAN(1, "中央分隔带"),
        SIDE_DIVIDER(2, "两侧分隔带"),
        ;
        private Integer key;
        private String value;

        SeparatorEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(SeparatorEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(SeparatorEnum.class, value);
        }
    }

    /**
     * 机动车道 分隔带形式枚举类
     */
    public enum SeparatorTypeEnum implements IKeyValueEnum {
        NOTHING(0, "无"),
        DOUBLE_LINE(1, "双线"),
        SINGLE_LINE(2, "单线"),
        GUARDRAIL(3, "护栏"),
        YELLOW_SLASH(4, "黄斜线"),
        GREEN_BELT(5, "绿化带"),
        CEMENT_PIER(6, "水泥墩"),
        ANTI_CRAWLING(7, "防爬网"),
        ;
        private Integer key;
        private String value;

        SeparatorTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(SeparatorTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(SeparatorTypeEnum.class, value);
        }
    }

    /**
     * 慢行道 人非分隔形式枚举类
     */
    public enum SeparateTypeEnum implements IKeyValueEnum {
        PEOPLE_NOT_MIXED(1, "人非混行"),
        MARKING_ISOLATION(2, "标线隔离"),
        PHYSICAL_ISOLATION(3, "物理隔离"),
        ;
        private Integer key;
        private String value;

        SeparateTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(SeparateTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(SeparateTypeEnum.class, value);
        }
    }

    /**
     * 慢行道 分隔带枚举类
     */
    public enum PavementTypeEnum implements IKeyValueEnum {
        ASPHALT_CONCRETE(1, "沥青混凝土"),
        CEMENT_CONCRETE(2, "水泥混凝土"),
        OTHER(3, "其他"),
        ;
        private Integer key;
        private String value;

        PavementTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(PavementTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(PavementTypeEnum.class, value);
        }
    }

    /**
     * 隧道 布置形式枚举类
     */
    public enum BridgeLayoutFormEnum implements IKeyValueEnum {
        INTEGRAL(1, "整体式"),
        SEPARATE_TYPE(2, "分离式"),
        ;
        private Integer key;
        private String value;

        BridgeLayoutFormEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(BridgeLayoutFormEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(BridgeLayoutFormEnum.class, value);
        }
    }

    /**
     * 隧道 布置形式枚举类
     */
    public enum TunnelLayoutFormEnum implements IKeyValueEnum {
        SINGLE_HOLE_DOUBLE_LINE(1, "单洞双线"),
        DOUBLE_HOLE_SINGLE_TRACK(2, "双洞单线"),
        ;
        private Integer key;
        private String value;

        TunnelLayoutFormEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TunnelLayoutFormEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TunnelLayoutFormEnum.class, value);
        }
    }

    /**
     * 路段设施调查任务 道路等级
     */
    public enum RoadGradeEnum implements IKeyValueEnum {
        EXPRESSWAY(1, "快速路"),
        TRUNK_ROAD(2, "主干路"),
        SECONDARY_TRUNK_ROAD(3, "次干路"),
        ACCESS_RD(4, "支路"),
        ;
        private Integer key;
        private String value;

        RoadGradeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(RoadGradeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(RoadGradeEnum.class, value);
        }
    }

    /**
     * 路段设施调查任务 断面形式枚举类
     */
    public enum RoadSectionFormEnum implements IKeyValueEnum {
        SINGLE_CARRIAGEWAY_ROAD(1, "单幅路"),
        DUAL_CARRIAGEWAY_ROAD(2, "双幅路"),
        TRIPLE_CARRIAGEWAY_ROAD(3, "三幅路"),
        CARRIAGEWAY_ROAD(4, "四幅路"),
        ;
        private Integer key;
        private String value;

        RoadSectionFormEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(RoadSectionFormEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(RoadSectionFormEnum.class, value);
        }
    }

    /**
     * 路段设施调查任务 单行路枚举类
     */
    public enum OneWayRoadEnum implements IKeyValueEnum {
        YES(1, "是"),
        NO(0, "否"),
        ;
        private Integer key;
        private String value;

        OneWayRoadEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(OneWayRoadEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(OneWayRoadEnum.class, value);
        }
    }

    /**
     * 路段设施调查任务 道路方向枚举类
     */
    public enum RoadDirectionEnum implements IKeyValueEnum {
        START_TO_END(1, "起点至终点"),
        END_TO_START(2, "终点至起点"),
        ;
        private Integer key;
        private String value;

        RoadDirectionEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(RoadDirectionEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(RoadDirectionEnum.class, value);
        }
    }

    /**
     * 路段设施调查任务 公交站点-接驳设施枚举类
     */
    public enum BusConnectionFacilitiesEnum implements IKeyValueEnum {
        RAIL_TRANSIT(1, "有轨道交通"),
        NON_MOTOR_VEHICLE(2, "非机动车"),
        TAXI(3, "出租车"),
        MINIBUS(4, "小客车"),
        ;
        private Integer key;
        private String value;

        BusConnectionFacilitiesEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(BusConnectionFacilitiesEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(BusConnectionFacilitiesEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(BusConnectionFacilitiesEnum.class);
        }
    }

    /**
     * 路段设施调查任务 地铁站点-站台类型枚举类
     */
    public enum MetroPlatformTypeEnum implements IKeyValueEnum {
        ORIGIN_TERMINAL_STATION(1, "首末站"),
        TRANSFER_STATION(2, "换乘站"),
        GENERAL_STATION(3, "一般站"),
        ;
        private Integer key;
        private String value;

        MetroPlatformTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(MetroPlatformTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(MetroPlatformTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(MetroPlatformTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 地铁站点-接驳设施枚举类
     */
    public enum MetroConnectionFacilitiesEnum implements IKeyValueEnum {
        BUS(1, "常规公交"),
        NON_MOTOR_VEHICLE(2, "非机动车"),
        TAXI(3, "出租车"),
        MINIBUS(4, "小客车"),
        ;
        private Integer key;
        private String value;

        MetroConnectionFacilitiesEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(MetroConnectionFacilitiesEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(MetroConnectionFacilitiesEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(MetroConnectionFacilitiesEnum.class);
        }
    }


    /**
     * 路段设施调查任务 地铁出入口-站台类型枚举类
     */
    public enum MetroGateWayPlatformTypeEnum implements IKeyValueEnum {
        ORIGIN_TERMINAL_STATION(1, "首末站"),
        TRANSFER_STATION(2, "换乘站"),
        GENERAL_STATION(3, "一般站"),
        ;
        private Integer key;
        private String value;

        MetroGateWayPlatformTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(MetroGateWayPlatformTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(MetroGateWayPlatformTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(MetroGateWayPlatformTypeEnum.class);
        }
    }


    /**
     * 路段设施调查任务 地铁站点-用地类型枚举类
     */
    public enum MetroGateWaylandUseTypeEnum implements IKeyValueEnum {
        HABITANCY(1, "居住"),
        PUBLIC_MANAGEMENT(2, "公共管理与公共服务"),
        COMMERCIAL_SERVICE_FACILITIES(3, "商业服务设施"),
        INDUSTRY(4, "工业"),
        LOGISTICS_WAREHOUSING(5, "物流仓储"),
        ROAD_AND_TRAFFIC_FACILITIES(6, "道路与交通设施"),
        COMMUNAL_FACILITIES(7, "公共设施"),
        GREEN_SPACE_AND_SQUARE(8, "绿地与广场"),
        ;
        private Integer key;
        private String value;

        MetroGateWaylandUseTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(MetroGateWaylandUseTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(MetroGateWaylandUseTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(MetroGateWaylandUseTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 路内停车-停放车种枚举类
     */
    public enum ParkingTypeEnum implements IKeyValueEnum {
        VEHICLE(1, "机动车"),
        NON_MOTOR_VEHICLE(2, "非机动车"),
        NON_STOP(3, "机非混停"),
        ;
        private Integer key;
        private String value;

        ParkingTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ParkingTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ParkingTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ParkingTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 路内停车-停放位置枚举类
     */
    public enum ParkingPositionTypeEnum implements IKeyValueEnum {
        ROADWAY(1, "车行道"),
        SIDEWALK(2, "人行道"),
        ROADWAY_SIDEWALK(3, "兼占"),
        ;
        private Integer key;
        private String value;

        ParkingPositionTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ParkingPositionTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ParkingPositionTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ParkingPositionTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 路内停车-停放方式枚举类
     */
    public enum ParkingModeTypeEnum implements IKeyValueEnum {
        VERTICAL(1, "垂直式"),
        PARALLEL(2, "平行式"),
        OBLIQUE_FORM(3, "斜列式"),
        ;
        private Integer key;
        private String value;

        ParkingModeTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ParkingModeTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ParkingModeTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ParkingModeTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 路内停车-停车标志枚举类
     */
    public enum StopSignEnum implements IKeyValueEnum {
        YES(1, "有停车标志（标线）"),
        NO(2, "无标志标线"),
        ;
        private Integer key;
        private String value;

        StopSignEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(StopSignEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(StopSignEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(StopSignEnum.class);
        }
    }

    /**
     * 路段设施调查任务 自行车停放点-类型枚举类
     */
    public enum ParkingLotTypeEnum implements IKeyValueEnum {
        VERTICAL_SINGLE_ARRANGEMENT(1, "垂直单排列"),
        VERTICAL_DOUBLE_ARRANGEMENT(2, "垂直双排列"),
        OBLIQUE_SINGLE_PERMUTATION(3, "斜单排列"),
        OBLIQUE_DOUBLE_ARRANGEMENT(4, "斜双排列"),
        ;
        private Integer key;
        private String value;

        ParkingLotTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ParkingLotTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ParkingLotTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ParkingLotTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 过街设施-建造位置枚举类
     */
    public enum ConstructionLocationEnum implements IKeyValueEnum {
        ROAD_SECTION(1, "道路路段"),
        ROAD_INTERSECTION(2, "道路交叉口"),
        RAILWAY(3, "铁路"),
        SQUARE(4, "广场"),
        ;
        private Integer key;
        private String value;

        ConstructionLocationEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ConstructionLocationEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ConstructionLocationEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ConstructionLocationEnum.class);
        }
    }

    /**
     * 路段设施调查任务 过街设施-连接形式枚举类
     */
    public enum ConnectionFormEnum implements IKeyValueEnum {
        STAIRWAY(1, "梯道"),
        RAMP(2, "坡道"),
        ESCALATOR(3, "自动扶梯"),
        VERTICAL_ELEVATOR(4, "垂直电梯"),
        LIFTING_PLATFORM(5, "升降平台"),
        ;
        private Integer key;
        private String value;

        ConnectionFormEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ConnectionFormEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ConnectionFormEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ConnectionFormEnum.class);
        }
    }

    /**
     * 路段设施调查任务 收费站-建造位置枚举类
     */
    public enum TollGateConstructionLocationEnum implements IKeyValueEnum {
        PRINCIPAL_LINE(1, "在主线上"),
        INTERCHANGE_OR_CONNECTING_LINE(2, "在立体交叉匝道或连接线上"),
        ;
        private Integer key;
        private String value;

        TollGateConstructionLocationEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TollGateConstructionLocationEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TollGateConstructionLocationEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(TollGateConstructionLocationEnum.class);
        }
    }

    /**
     * 路段设施调查任务 收费站-车道数枚举类
     */
    public enum TollGateLaneTotalEnum implements IKeyValueEnum {
        HIGH_SPEED_IN(1, "进高速方向"),
        HIGH_SPEED_OUT(2, "出高速方向"),
        ;
        private Integer key;
        private String value;

        TollGateLaneTotalEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TollGateLaneTotalEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TollGateLaneTotalEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(TollGateLaneTotalEnum.class);
        }
    }

    /**
     * 路段设施调查任务 交通标志-标志类型枚举类
     */
    public enum TrafficSignTypeEnum implements IKeyValueEnum {
        WARNING(1, "警告标志"),
        PROHIBITION(2, "禁令标志"),
        MANDATORY(3, "指示标志"),
        GUIDE(4, "指路标志"),
        OTHER(5, "其他标志"),
        ;
        private Integer key;
        private String value;

        TrafficSignTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TrafficSignTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TrafficSignTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(TrafficSignTypeEnum.class);
        }
    }

    /**
     * 路段设施调查任务 交通标志-标志类型二级标志枚举类
     */
    public enum TrafficSignChildTypeEnum implements IKeyValueEnum {
        GRADE_CROSSING(1, "与平面交叉相关标志", 1),
        HORIZONTAL_ALIGNMENT(2, "与道路平面线形相关标志", 1),
        VERTICAL_ALIGNMENT(3, "与道路纵断面线形相关标志", 1),
        CROSS_SECTION_ALIGNMENT(4, "与道路横断面线形相关标志", 1),
        TRAFFIC_FLOW(5, "与交通流状况相关标志", 1),
        DANGER(6, "与可能出现危险状况相关标志", 1),
        SAFETY_MEASURES(7, "与建议安全措施相关标志", 1),

        ROAD_PRIORITY(8, "与道路优先权相关标志", 2),
        RIGHT_OF_WAY_SIGN(9, "与道路通行权相关标志", 2),
        TRAFFIC_CONTROL(10, "与交通管理相关标志", 2),
        DIRECTION_RIGHT_OF_WAY(11, "与某方向通行权相关标志", 2),
        LIMIT(12, "与限制相关标志", 2),
        PARKING_AND_INSPECTION(13, "与停车和检查相关标志", 2),

        DIRECTION_OF_TRAVEL(14, "与车辆行驶方向有关的指示标志", 3),
        DRIVING_BEHAVIOR(15, "指导驾驶行为的指示标志", 3),
        PURPOSE_OF_LANE_USE(16, "与车道使用目的有关的指示标志", 3),
        RIGHT_OF_WAY_INSTRUCTIONS(17, "与道路路权有关的指示标志", 3),

        ACCESS_RD_ROUTE_GUIDANCE_SIGNS(18, "干路和支路-路径指引标志", 4),
        LOCATION_GUIDE_SIGNS(19, "干路和支路-地点指引标志", 4),
        TRANSPORTATION_FACILITIES(20, "干路和支路-交通设施指引标志", 4),
        TRAFFIC_MANAGEMENT_INFORMATION(21, "干路和支路-交通管理信息指引标志", 4),
        EXPRESSWAY_ROUTE_GUIDANCE_SIGNS(22, "快速路-路径指引标志", 4),
        INFORMATION_ALONG_THE_LINE(23, "快速路-沿线信息指引标志", 4),
        ROADSIDE_FACILITIES(24, "快速路-沿线设施指引标志", 4),

        TOURIST_AREA_SIGN(25, "旅游区标志", 5),
        OPERATION_AREA_SIGN(26, "作业区标志", 5),
        AUXILIARY_SIGNS(27, "辅助标志", 5),
        NOTICE_SIGN(28, "告示标志", 5),
        ;
        private Integer key;
        private String value;
        private Integer parentKey;

        TrafficSignChildTypeEnum(Integer key, String value, Integer parentKey) {
            this.key = key;
            this.value = value;
            this.parentKey = parentKey;
        }

        @Override
        public Integer getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }

        public Integer getParentKey() {
            return parentKey;
        }

        /**
         * 根据父节点ID获取子节点value集合
         *
         * @param parentKey
         * @return
         */
        public static ArrayList<String> getValueListByParentKey(Integer parentKey) {
            TrafficSignChildTypeEnum[] enumConstants = values();
            ArrayList<String> list = new ArrayList<>();
            for (TrafficSignChildTypeEnum eObj : enumConstants) {
                if (eObj.getParentKey().equals(parentKey)) {
                    list.add(eObj.getValue());
                }
            }
            return list;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TrafficSignChildTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TrafficSignChildTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(TrafficSignChildTypeEnum.class);
        }
    }

    /**
     * 路段交通量调查任务 通行类型
     */
    public enum RoadSectionTrafficTypeEnum implements IKeyValueEnum {
        TWO_WAY_TRAFFIC(1, "双向通行"),
        ONE_WAY_TRAFFIC(2, "单向通行"),
        ;
        private Integer key;
        private String value;

        RoadSectionTrafficTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(RoadSectionTrafficTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(RoadSectionTrafficTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(RoadSectionTrafficTypeEnum.class);
        }
    }

    /**
     * 路段交通量调查任务 方向
     */
    public enum RoadSectionDirectionEnum implements IKeyValueEnum {
        WEST_TO_EAST(1, "西向东"),
        EAST_TO_WEST(2, "东向西"),
        NORTH_TO_SOUTH(3, "南向北"),
        SOUTH_TO_NORTH(4, "北向南"),
        ;
        private Integer key;
        private String value;

        RoadSectionDirectionEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public String getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(RoadSectionDirectionEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(RoadSectionDirectionEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(RoadSectionDirectionEnum.class);
        }
    }

    /**
     * 路口交通量调查任务 路口类型
     */
    public enum IntersectionTypeEnum implements IKeyValueEnum {
        T_INTERSECTIONS(1, "T型交叉口"),
        Y_INTERSECTIONS(2, "Y型交叉口"),
        X_INTERSECTIONS(3, "X型交叉口"),
        MULTI_WAY_INTERSECTION(4, "多路交叉口"),
        ;
        private Integer key;
        private String value;

        IntersectionTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(IntersectionTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(IntersectionTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(IntersectionTypeEnum.class);
        }
    }

    /**
     * 路口交通量调查任务 管控方式
     */
    public enum ControlModeEnum implements IKeyValueEnum {
        NO_CONTROL_AT_ALL(1, "全无控制"),
        SIGN_CONTROL(2, "标志控制"),
        SIGNAL_CONTROL(3, "信号控制"),
        ;
        private Integer key;
        private String value;

        ControlModeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(ControlModeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(ControlModeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(ControlModeEnum.class);
        }
    }

    /**
     * 交通量调查任务 模式
     */
    public enum TrafficPatternTypeEnum implements IKeyValueEnum {
        OFFICE_WORK(1, "内业"),
        FIELD_OPERATION(2, "外业"),
        ;
        private Integer key;
        private String value;

        TrafficPatternTypeEnum(Integer key, String value) {
            this.key = key;
            this.value = value;
        }

        @Override
        public Object getKey() {
            return key;
        }

        @Override
        public Object getValue() {
            return value;
        }

        public static String getValueByKey(Integer key) {
            return (String) KeyValueEnumUtil.getValueByKey(TrafficPatternTypeEnum.class, key);
        }

        public static Integer getKeyByValue(String value) {
            return (Integer) KeyValueEnumUtil.getKeyByValue(TrafficPatternTypeEnum.class, value);
        }

        @SuppressWarnings("all")
        public static List<String> getEnumValueList() {
            return KeyValueEnumUtil.getEnumValueList(TrafficPatternTypeEnum.class);
        }
    }
}
